package com.project.mapper;

import com.project.bean.FacilityBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IFacilityDao {
    /**
     * 按房间id查看损坏记录
     * @param roomId 房间id
     * @return 损坏设施集合
     */
    List<FacilityBean> findByRoom(Integer roomId);

    /**
     * 添加设施损坏信息
     * @param facilityBean 损坏设施对象
     * @param roomId  房间id
     */
    void damageInfo(@Param("facilityBean") FacilityBean facilityBean, @Param("roomId") Integer roomId);

    /**
     * 按设施id修改设施状态
     * @param facilityId 设施id
     * @param state  设施状态
     */
    void updateFacility(@Param("facilityId") Integer facilityId,@Param("state") String state);

    /**
     * 统计指定房间指定状态的设施记录的数量
     * @param roomId 房间id
     * @param state 设施状态
     * @return 设施记录的数量
     */
    int countRoom(@Param("roomId") int roomId,@Param("state") String state);

    /**
     * 按房间id删除设施记录
     * @param roomId 房间id
     */
    void delete(Integer roomId);


}
